package com.lzh.seatrend.util.commonsbeanutils;


import org.springframework.beans.BeanUtils;
import org.junit.Test;

import java.util.HashMap;

/**
 * 英语: populate : 添加数据，输入数据
 */
public class BeanUtilsTest {

    @Test
    public void test() throws Exception{
        UserInfo userInfo = new UserInfo();
        UserOldInfo userOldInfo = new UserOldInfo("1");
        UserInfo userInfo1= new UserInfo();
        HashMap<String,String> properties = new HashMap<>();
        properties.put("userId","lzh");
        properties.put("userName","刘子昊");
        BeanUtils.copyProperties(properties,userInfo);
        BeanUtils.copyProperties(userOldInfo,userInfo1);
        System.out.println(userInfo);
        System.out.println(userInfo1);
    }
}
